import static org.junit.Assert.*;


import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;


public class LiczbaTest4 {
	
	@Before
	public void setUp() throws Exception {
	}

	@Test
		public void testKonstruktorDomyslny() throws Exception
		{
			Liczba l = new Liczba();
			for(int i=2; i<=16; i++) {
				
				assertNotNull(l.zapis(i));
				
				
			}
		}
	
	@Test(expected=LiczbaException.class)
    public void testOdKolegi2()throws Exception{

        new Liczba("10", 0);
    }
	
		@Test(expected=LiczbaException.class)
		public void testZaMalaPodstawa() throws Exception {
			
				new Liczba("10", 1);
				
			
		}
		
		@Test(expected=LiczbaException.class)
		public void testZaDuzaPodstawa() throws Exception {
		
				new Liczba("10", 17);
			
		}
		
		@Test(expected=LiczbaException.class)
		public void testPodstawaWZapisieZaMala() throws Exception {
		
				new Liczba("10", 2).zapis(1);
			
		}

		@Test(expected=LiczbaException.class)
		public void testPodstawaWZapisieZaDuza() throws Exception {
			
				new Liczba("10", 16).zapis(17);
				
			
		}

		
		
		@Test(timeout=500)
		public void powolnyTest() throws Exception
		{
			String[] in = {"27", "36", "72"};
			String[][] out = {
					{"11011", "1000", "123", "102", "43", "36", "33", "30", "27", "25", "23", "21", "1D", "1C", "1B"},
					{"100100", "1100", "210", "121", "100", "51", "44", "40", "36", "33", "30", "2A", "28", "26", "24"}, 
					{"1001000", "2200", "1020", "242", "200", "132", "110", "80", "72", "66", "60", "57", "52", "4C", "48"}
			};
			for(int i=0; i<in.length; i++) {
				Liczba l = new Liczba(in[i], 10);
				for(int k = 0; k<out.length; k++) {
					assertEquals(l.zapis(k+2),out[i][k]);
				}
				
			}
		
		}
		
		@Ignore
		public void noneTest() {
					//nic
			}

		
		@After
		public void tearDown() throws Exception {
		}

}
